export default function enterFullscreen(el?: HTMLElement) {
  const target = el ?? document.documentElement;
  let fullscreenFunc = target.requestFullscreen;
  if (!fullscreenFunc) {
    [
      "mozRequestFullScreen",
      "msRequestFullscreen",
      "webkitRequestFullScreen",
    ].forEach(function (req) {
      fullscreenFunc = fullscreenFunc || (target as any)[req];
    });
  }
  fullscreenFunc.call(target);
}
